import orderApi from '@/config/server/api/order'

function list(info) {
  return orderApi.commission.payment.list.fetch(info).then((res) => {
    res.list = res.list.map((item) => {
      return {
        ...item.byOrgDTO,
        ...item.orCommissionBack
      }
    })
    return res
  })
}

function detail(backId) {
  return orderApi.commission.payment.detail.fetch({ backId })
}

function apply(info) {
  return orderApi.commission.payment.apply.fetch(info)
}

function del(backId) {
  return orderApi.commission.payment.delete.fetch({ backId })
}

export default {
  list,
  detail,
  apply,
  del
}
